<?php

/**
 * 图文消息管理logic
 */

namespace Wechat\Logic;

class NewsmsgLogic extends BaseLogic {
    
	/**
	 * 查询文本消息内容
	 * @param id $id 消息id
	 */
	public function detail($map = array()){
		$map['uid'] = WID;
		$openid = session('openid');
		$data = $this->where($map)->find();
		
		$data['configs'] = serializeMysql($data['configs'],1);
		//logs($data);
		//$count = count($data['configs']);
		if(!isset($data['configs']['Url'])){
			foreach ($data['configs'] as &$v){
				
				$v['Url'] = apiurl($v['Url'],WID).$openid;
				
			}
		}else{
			$data['configs']['Url'] = apiurl($data['configs']['Url'],WID).$openid;
		}
		return $data;
		
	}
	
	/* (non-PHPdoc)
	 * @see \Wechat\Logic\BaseLogic::autoSave()
	*/
	public function autoSave($id = 0) {
		// TODO Auto-generated method stub
	
	}
	
	/* (non-PHPdoc)
	 * @see \Wechat\Logic\BaseLogic::update()
	*/
	public function update($id = 0) {
		// TODO Auto-generated method stub
	
	}
	
	
	
}